<template>
  <div>
    <h3>项目配置</h3>
    <el-row :gutter="20">
      <el-col :span="4" class="col-package">
        包名：
        <el-input class="input-package" placeholder="项目包名" v-model="projectSetting.projectPackage"/>
      </el-col>
      <el-col :span="6" class="col-save-path">
        保存路径：
        <el-input class="input-save-path" placeholder="保存路径" v-model="projectSetting.codePath"/>
      </el-col>
      <el-col :span="4" class="col-table-prefix">
        表前缀：
        <el-input class="input-table-prefix" placeholder="表前缀" v-model="projectSetting.tablePrefix"/>
      </el-col>
      <el-col :span="4" class="col-author">
        作者：
        <el-input class="input-author" placeholder="作者" v-model="projectSetting.author"/>
      </el-col>
      <el-col :span="6" class="col-copyright">
        版权信息：
        <el-input type="textarea" :rows="1" style="max-height: 32px" class="input-copyright" placeholder="版权信息" v-model="projectSetting.copyright"/>
      </el-col>
    </el-row>

    <el-row >
      <el-col :span="7" :gutter="5">
        <el-col :span="8">
          <el-radio class="mybatis-type" v-model="projectSetting.ormType" :label="1">mybatis</el-radio>
        </el-col>
        <el-col :span="10">
          <el-radio class="mybatis-type" v-model="projectSetting.ormType" :label="2">mybatis plus</el-radio>
        </el-col>
        <el-col :span="5">
          <el-radio class="mybatis-type" v-model="projectSetting.ormType" :label="3">JPA</el-radio>
        </el-col>
      </el-col>
      <el-col :span="16" :gutter="5">
        <el-col :span="5">
          <el-checkbox label="swagger注解" v-model="projectSetting.useSwagger"/>
        </el-col>
        <el-col :span="4">
          <el-checkbox label="shiro注解" v-model="projectSetting.useShiro"/>
        </el-col>
        <el-col :span="5">
          <el-checkbox label="lombok注解" v-model="projectSetting.useLombok"/>
        </el-col>
        <el-col :span="5">
          <el-checkbox label="生成service" v-model="projectSetting.createService"/>
        </el-col>
        <el-col :span="5">
          <el-checkbox label="生成controller" :disabled="!projectSetting.createService"
                       v-model="projectSetting.createController"/>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import {mapGetters} from "vuex";

  export default {
    name: "Project",
    computed: {
      ...mapGetters(["projectSetting"])
    }
  }
</script>

<style scoped>
  @import "../../../static/css/content.css";

  .input-save-path {
    width: 60%;
  }

  .mybatis-type {
    margin-top: 10px;
  }

  .input-package {
    width: 64%;
  }

  .input-table-prefix {
    width: 42%;
  }

  .input-author {
    width: 58%;
  }

  .input-copyright {
    width: 63%;
  }

  .col-package, .col-save-path, .col-table-prefix, .col-author, .col-copyright {
    padding-right: 0px !important;
  }

  .col-table-prefix {
    width: 14.667%;
  }

</style>
